
<div id="picAddress" class="tableform widgetconfig"> 
  <h4><{t app="b2c"}>基本设置<{/t}></h4>
  <div class="division">
    <table width="100%" cellpadding="0" cellspacing="0">
      <tr>
        <th><{t app="b2c"}>鼠标触发类型<{/t}></th>
        <td><label><input type="radio" name="mousetype" value="click" <{if $setting.mousetype=="click"}>checked="checked"<{/if}>><{t app="b2c"}>鼠标点击<{/t}></label> &nbsp; &nbsp; <label><input type="radio" name="mousetype" value="mouse" <{if $setting.mousetype!="click"}>checked="checked"<{/if}>><{t app="b2c"}>鼠标移过<{/t}></label></td>
        <th>&nbsp;</th>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <th><{t app="b2c"}>广告宽度<{/t}></th>
        <td><input name='width' value="<{$setting.width|default:300}>" size="4">px</td>
        <th><{t app="b2c"}>广告高度<{/t}></th>
        <td><input name='height' value="<{$setting.height|default:250}>" size="4">px</td>
      </tr>
      <tr>
        <th><{t app="b2c"}>轮播效果<{/t}></th>
        <td><select name='direction'>
			<option value="scrollx" <{if $setting.direction=='Left'}>selected<{/if}>><{t app="b2c"}>左右<{/t}></option>
			<option value="scrolly" <{if $setting.direction=='Top'}>selected<{/if}>><{t app="b2c"}>上下<{/t}></option>
			<option value="fade" <{if $setting.direction=='Fade'}>selected<{/if}>><{t app="b2c"}>透明<{/t}></option>
			</select>
		
        <th><{t app="b2c"}>轮播速度<{/t}></th>
        <td><select name='stayTime'>
			<option value="2000" <{if $setting.stayTime==2000}>selected<{/if}>><{t app="b2c"}>快<{/t}></option>
			<option value="3000" <{if $setting.stayTime==3000}>selected<{/if}>><{t app="b2c"}>普通<{/t}></option>
			<option value="5000" <{if $setting.stayTime==5000}>selected<{/if}>><{t app="b2c"}>慢<{/t}></option>
			</select>
		</td>
      </tr>
      <tr>
        <th><{t app="b2c"}>普通数字背景<{/t}></th>
        <td>#<input name='oriBackground' value="<{$setting.oriBackground|default:'efefef'}>" size="6"></td>
        <th><{t app="b2c"}>普通数字颜色<{/t}></th>
        <td>#<input name='orifontcolor' value="<{$setting.orifontcolor|default:'0e0e0e'}>" size="6"></td>
      </tr>
      <tr>
        <th><{t app="b2c"}>焦点数字背景<{/t}></th>
        <td>#<input name='curBackground' value="<{$setting.curBackground|default:'ff6600'}>" size="6"></td>
        <th><{t app="b2c"}>焦点数字颜色<{/t}></th>
        <td>#<input name='curfontcolor' value="<{$setting.curfontcolor|default:'ffffff'}>" size="6"></td>
      </tr>
    </table>
  </div>
  <h4><{t app="b2c"}>已添加的图片<{/t}></h4>
  <div class="division">
  <{button label=$___b2c="添加图片"|t:'b2c' app="desktop" icon="btn_add.gif" onCLick="addPic()"}>
  <{foreach from=$setting.pic item=data key=key}>
  <input type='hidden' name='pic[<{$data.id}>][id]' value="<{$data.id}>"/>
  <table id="pic_<{$data.id}>" width="100%" cellpadding="0" cellspacing="0">
  <tr>
  <th><{t app="b2c"}>图片地址:<{/t}></th>
  <td><input name=pic[<{$data.id}>][link] id=pic[<{$data.id}>][link]  value="<{$data.link}>"></td><td><input type=button value=<{t app="b2c"}>上传图片<{/t}> onClick=load_photo_collect($('pic[<{$data.id}>][link]'))></td>
  <th><{t app="b2c"}>图片链接:<{/t}></th>
  <td><input name=pic[<{$data.id}>][linktarget] value="<{$data.linktarget}>"> </td><td><span onclick="delLink('pic_<{$data.id}>');"><{img src="delecate.gif" style="cursor:pointer;" alt=$___b2c="删除"|t:'b2c' title=$___b2c="删除"|t:'b2c'}></span></td>
  </tr>
  </table>
<{/foreach}> 
<div class="addpiccontent">
</div>

<!--<span class="sysiconBtn addorder" onCLick="addPic()">添加图片</span><br />
-->    </div>
</div>
<script>
function addPic(){
	var d=new Date();
	var i=d.getTime();
	var content='\
			  <table id="pic_'+i+'" width="100%" cellpadding="0" cellspacing="0">\
			  <input type=hidden name=pic['+i+'][id] value="'+i+'">\
			  <tr>\
				  <th><{t app="b2c"}>图片地址:<{/t}></th>\
				  <td><input name=pic['+i+'][link] id=pic['+i+'][link]>&nbsp;<input type=button value=<{t app="b2c"}>上传图片<{/t}> onClick=load_photo_collect($(\'pic['+i+'][link]\'))></td>\
				  <th><{t app="b2c"}>图片链接:<{/t}></th>\
				  <td><input style=" width:285px" name=pic['+i+'][linktarget]></td><td><span onclick="delLink(\'pic_'+i+'\');"><{img src="delecate.gif" style="cursor:pointer;" alt=$___b2c="删除"|t:'b2c' title=$___b2c="删除"|t:'b2c'}></span></td>\
			  </tr>\
			  </table>\
			  ';
			  $E('#picAddress .addpiccontent').adopt(new Element('div').set('html',content).getFirst());


}
delLink=function(o){
  $(o).remove();
}

function load_photo_collect(target){
		var url='index.php?app=desktop&act=alertpages&goto='+encodeURIComponent("index.php?app=image&ctl=admin_manage&act=image_broswer&type=big");
		return new imgDialog(url,{onCallback:function(image_id,image_src){						
				target.value=image_src;				
		}})		
}

</script>
